<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>请求乱码处理</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8"); // 设置请求编码
    response.setCharacterEncoding("UTF-8"); // 设置响应编码
    String msg = request.getParameter("msg"); // 接收请求参数
    String url = request.getParameter("url"); // 接收请求参数
    int level = Integer.parseInt(request.getParameter("level")); // 接收的参数数据并转型
    String levelContent = null;
    switch(level) {
        case 0:
            levelContent = "绝密";
            break;
        case 1:
            levelContent = "秘密";
            break;
        case 2:
            levelContent = "普通";
            break;
        case 3:
            levelContent = "公开";
            break;
    }
%>
<h1><%=msg%>：<%=url%></h1>
<h1>信息等级：<%=levelContent%></h1>
</body>
</html>
